{% extends "GitonomyWebsiteBundle::layout.html.twig" %}

{% trans_default_domain 'navigation_project' %}

{% set global_navigation = 'projects' %}

{% block content %}
    <h1 class="with-menu">
        {{ project.name }}
    </h1>

    <div id="wrapper">
        <ul id="local-menu">
            {% set slug = project.slug %}
            {% if project.empty %}
                <li><a href="{{ path('project_newsfeed', {slug: slug }) }}"{% if local_navigation == 'empty' %} class="active"{% endif %}>{{ 'menu.empty'|trans }}</a></li>
            {% else %}
                <li><a href="{{ path('project_newsfeed', {slug: slug }) }}"{% if local_navigation == 'newsfeed' %} class="active"{% endif %}>{{ 'menu.newsfeed'|trans }}</a></li>
                <li><a href="{{ path('project_history', {slug: slug }) }}"{% if local_navigation == 'history' %} class="active"{% endif %}>{{ 'menu.history'|trans }}</a></li>
                <li><a href="{{ path('project_tree', {slug: project.slug, revision: project.defaultBranch}) }}"{% if local_navigation == 'source' %} class="active"{% endif %}>{{ 'menu.source'|trans }}</a></li>
                <li><a href="{{ path('project_branches', {slug: slug }) }}"{% if local_navigation == 'branches' %} class="active"{% endif %}>{{ 'menu.branches'|trans }}</a></li>
                <li><a href="{{ path('project_tags', {slug: slug }) }}"{% if local_navigation == 'tags' %} class="active"{% endif %}>{{ 'menu.tags'|trans }}</a></li>
            {% endif %}
            {% if is_granted('PROJECT_ADMIN', project) %}
                <li><a href="{{ path('project_permissions', {slug: slug }) }}"{% if local_navigation == 'permissions' %} class="active"{% endif %}>{{ 'menu.permissions'|trans }}</a></li>
                <li><a href="{{ path('project_admin', {slug: slug }) }}"{% if local_navigation == 'admin' %} class="active"{% endif %}>{{ 'menu.admin'|trans }}</a></li>
            {% endif %}
        </ul>

        <div id="content" class="with-menu">
            {% block project_content '' %}
        </div>
    </div>
{% endblock %}
